Repository navigation
Conversation
|
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
|
| Check name | Status | Explanation |
|---|---|---|
| Persistence Integrity | The check fails only when a changed persistence path can lose or corrupt state. I reviewed the changed persistence paths in commit 89acdbd (PR #2809, head issue/2085, author edelauna). - `scripts/agen… |
|
| Lifecycle Resource Cleanup | Reviewed the changed lifecycle paths in PR #2809 (head 89acdbd, merge-base 6df2566). I found no path that leaks a listener, watcher, provider, timer, task, or other resource, and no duplicate work aft… |
Full details: Persistence Integrity
-
Explanation
The check fails only when a changed persistence path can lose or corrupt state. I reviewed the changed persistence paths in commit 89acdbd (PR
#2809, head issue/2085, author edelauna). -scripts/agent-evals/release-baselines.ts:329-343(writeBaselineProposal): it writes the baseline record withflag: "wx", then writesindex.jsonwith a plainfs.writeFile. The index write is not atomic. The repo hasfs-atomic.ts(writeFileAtomic), which sibling code uses (coding-compare.ts,host-build.ts). A crash or ENOSPC during the index write could leave a truncatedindex.json. A crash between the two writes could leave an orphan record that makes a retry fail with EEXIST. The existing test atrelease-baselines.test.ts:206-209covers only the EEXIST-before-index case. -scripts/agent-evals/baseline-proposal.ts:79-98(applyBaselineProposal): it checks the index digest before writing. Its tests cover rejection of a changed index. -scripts/agent-evals/fs-atomic.tsandsrc/utils/safeWriteJson.ts: these are reused by new code, and the calls are awaited. -scripts/agent-evals/promote-baseline.mts:110:safeWriteJsonis awaited. The proposal is digest-checked before use. -scripts/agent-evals/release-baselines.ts:401-404(fetchBaselineSnapshot): it writes withwxinto a snapshot directory fromauthorize-evaluation.mts. This is a fresh download, not a durable store. -src/utils/jsonFileRecovery.ts:212-228: thebackupStats[0]!change keeps the same guard and behavior. The non-atomic index write is a real hardening gap. Its impact is limited, though. The durable baseline state is the Gitmaintree, and the PR states that a reviewed PR publishes the pointer change. Writes happen in an apply workspace before review and commit, and index and record loads validate digests and JSON. A crash there leaves a damaged working-tree file, not lost or corrupt durable state. Loss would need a corrupted file to be committed without review. Note: the PR description says the proposal writer usessafeWriteJson.writeBaselineProposaldoes not. Onlypromote-baseline.mtsusessafeWriteJson. No changed path meets the stated failure condition, so the check passes. Residual risk: usewriteFileAtomicforindex.jsonand the record write to remove the partial-write window.
Full details: Lifecycle Resource Cleanup
-
Explanation
Reviewed the changed lifecycle paths in PR
#2809(head 89acdbd, merge-base 6df2566). I found no path that leaks a listener, watcher, provider, timer, task, or other resource, and no duplicate work after cancellation, disposal, or restart. Paths checked: - scripts/agent-evals/coding-side.mts and coding-compare.ts. The install and build steps now run in a loop throughrunBoundedPreparation. Each call checksisInterrupted()before it spawns, so an interrupt during install stops the build from starting. The timer is cleared on botherrorandexit. The process group is killed on exit. The preparation home is removed infinally. The worktree and scratch cleanup runs in the outertry/finally. - scripts/agent-evals/host-build.ts (new).verifyHostBuildOutputsonly callslstat,mkdir, and an atomic write. It opens no handles and starts no timers. - scripts/agent-evals/promote-baseline.mts and apply-baseline-proposal.mts. The scratch directory is created before itstry, andfs.rmruns infinally. - scripts/agent-evals/baseline-handoff.ts. It usesAbortSignal.timeout(15_000)for the webhook request. No listener or timer is left behind. - packages/telemetry/src/TelemetryService.ts. The newrecentExceptionFingerprintsmap is capped atEXCEPTION_DEDUPE_CACHE_LIMIT(100) and evicts its oldest entry, so it cannot grow without bound. The dedupe logic adds no timers or listeners. - src/api/providers/openrouter.ts and src/utils/jsonFileRecovery.ts. The changes are error-shaping and an index-access typing fix. They touch no resource lifecycle. - scripts/test-local.mjs. It uses synchronousspawnSync, so no child process outlives the call. A broad grep of added non-test lines for listeners, timers, watchers, spawns, and aborts matched only the paths above. Theprocess.on("SIGINT"/"SIGTERM")handlers in the driver scripts are pre-existing or belong to short-lived CLI drivers that exit after cleanup. Their registration does not create a leak in a changed path. Limits: the diff is large, and I did not read every test file or workflow YAML. I did not run the code.
Full details: Security Boundaries
-
Explanation
The tag lane of the evaluation gate does not enforce the approval it claims to enforce. Changed path: scripts/agent-evals/authorize-evaluation.mts (lines 26-49) and scripts/agent-evals/evaluation-authorization.ts (lines 36-38,
releaseReviewApproved). The PR description says tag evaluations "require fresh approval of the exact release PR head". The TLA note in docs/architecture/tla/EvalWorkflow.tla (line 36) says the properties "reject ... stale approvals". The code checks only three values:headRefOid === sha,reviewDecision === "APPROVED", andisDraft === false. It does not check that the approving review was submitted on that commit. GitHub keepsreviewDecisionas APPROVED after new commits are pushed, unless the branch protection setting that dismisses stale approvals is enabled. The repository does not contain that setting, and the code does not verify it. This is the same kind of check that label-pr-review-state.yml already performs (review.commit_id === pr.head.sha, around lines 1107-1143), so the repository has the pattern but this change does not use it. Triggering sequence: 1. A release PRrelease/vXis approved at head H1. 2. A contributor with branch write access pushes an unreviewed commit H2 to the release branch. 3. A person with protected-tag rights pushes tagvXat H2. 4.headRefOidequals H2 andreviewDecisionremains APPROVED, so the gate passes. 5. After environment approval, the job runs H2 withSOLHEIM_API_KEY(.github/workflows/agent-evals.yml, "Evaluate candidate" step). The gate can pass without approval of H2. The protected-tag rule and environment approval reduce the risk, but they do not replace the missing head-specific review check. The unit tests (evaluation-authorization.test.ts, lines 52-60) and workflow tests (agent-evals-workflow.test.mjs, lines 546 and 585) cover only mockedREVIEW_REQUIREDresponses, so they do not detect this gap. Other notes, not counted as separate failures: - The authorization step runs from the candidate checkout (ref: github.sha). Candidate code therefore controls the gate that checks it. - The trust policy written by the "Prepare trust policy" step lists only the candidate SHA. The side's trust gate therefore checks the candidate against itself. - The webhook, artifact-provenance, and promotion checks reviewed in notify-baseline.mts, baseline-handoff.ts, promote-baseline.mts, release-baselines.ts, and baseline-proposal.ts fail closed and do not log secrets. I found no defect in those paths.Resolution
Bind the tag-lane approval to the exact head SHA in code. Do not rely only on repository settings. Options: - Query the latest APPROVED review for the release PR and require its
commit_idto equal the tagged SHA (for example, through the REST reviews endpoint or GraphQLlatestReviews { commit { oid } }). - Or require that the repository enable stale-approval dismissal, and verify that setting in the workflow. Add tests that fail when an approval exists only on an earlier head, and whenreviewDecisionis APPROVED but the latest approval has a differentcommit_id. Then rerun the agent-evals unit and workflow tests.
Full details: Regression Evidence
-
Explanation
Summary: The PR adds release baseline logic with a broad test set. Two changed behaviors have concrete negative-case gaps at the unit-test layer. Gap 1 (main gap): product and measurement promotion guards. -
scripts/agent-evals/baseline-proposal.tsapplyBaselineProposal(lines 83-91) has aproductbranch. It throws "Establish a measurement baseline first" when no measurement pointer exists. It throws "A new measurement baseline needs explicit approval" when the measurement pins are incompatible with the proposal. -scripts/agent-evals/promote-baseline.mts(lines 79-84) repeats the same two guards forBASELINE_KIND=product. -scripts/agent-evals/baseline-proposal.test.tsimportsapplyBaselineProposal, but its only apply cases useproposal(), which haskind: "both"andbeforeIndex: { version: 1 }. The stale and fresh cases never reach theproductormeasurementbranches. -scripts/agent-evals-workflow.test.mjspromotion scenarios run only withBASELINE_KIND: "both". No test setsproductormeasurement. A grep for "Establish a measurement", "needs explicit approval", andBASELINE_KINDfinds no test that exercises these guards. - A plausible regression exists. Removing either guard would let a product pointer be written with no measurement baseline, or with a measurement baseline that is incompatible. The spec (#2085) says incompatible measurement inputs must not produce a normal comparison, and only an explicit maintainer action may set a new measurement baseline. Gap 2: repetition mismatch inrenderReleaseComparison. -scripts/agent-evals/release-baselines.tslines 249-252 setcompatibility.compatible = falsewhenbaseline.record.evidence.repetitions !== candidate.repetitions. -scripts/agent-evals/release-baselines.test.tstests changedpinsfields and runner fields, but never a changed repetition count. This negative case has no test. Checked and adequately covered: the baseline digest and provenance checks, source and release validation,fetchBaselineSnapshotpinning, the Discord handoff payload and webhook rejection cases, the OpenRouterhandleStreamingErrorchange (including thecodeundefined case), the telemetry single-capture change, thejsonFileRecoverytype-only change, and thecoding-summaryfailure paths (covered by scenario tests inagent-evals-workflow.test.mjs). Status: FAIL on the changed-behavior negative-case gaps above. Each gap has a lowest-layer test target in an existing test file.Resolution
- In scripts/agent-evals/baseline-proposal.test.ts, add applyBaselineProposal cases for kind "product" and kind "measurement": - kind "product" with an index that has no measurement pointer must reject with "Establish a measurement baseline first". The directory must stay unchanged. - kind "product" with a measurement pointer whose pins differ from the proposal must reject with "needs explicit approval". - kind "product" with a compatible measurement pointer must write the new record and update only the product pointer. - kind "measurement" must update only the measurement pointer. 2. In scripts/agent-evals/release-baselines.test.ts, add a case where candidate.repetitions differs from baseline.record.evidence.repetitions. Assert that renderReleaseComparison returns "Incompatible comparison" and lists "repetitions". 3. Optionally, add one BASELINE_KIND=product scenario to scripts/agent-evals-workflow.test.mjs for the same guard in promote-baseline.mts.
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Review statusThanks for contributing. This comment tracks the review sequence and the next action. Current step: Fix the failing required CI checks; awaiting-maintainer requires CI and automated review completion. Review-state labels are managed by this workflow; do not edit them manually. |
Changed-code mutation testingReport for PR head
Details: mutants, guidance, and reproductionChanged-code mutation testing
Focused tests
Reproduce locallyFrom a full checkout containing both commits: Mutation reports
The workflow uploads generated reports in the Advisory findings
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Related GitHub Issue
Closes #2085.
Description
Release evaluations need approved baselines and durable reports. This change adds stored-result comparisons and explicit baseline promotion.
Actions keeps read-only GitHub permissions. Actions does not create or approve PRs.
Promotion records its dispatch SHA. Unrelated main updates do not invalidate a proposal. Changed baseline pointers require a new proposal.
The proposal writer uses
safeWriteJson. A small typing fix preserves existing backup recovery behavior under strict indexed-access checks.This supports Reliability First through repeatable release evidence and explicit approval.
Test Procedure
Local offline validation passed:
pnpm test:agent-evals:unit node --test scripts/agent-evals-workflow.test.mjs pnpm --dir src exec vitest run utils/__tests__/jsonFileRecovery.test.ts pnpm agent-evals:check-types pnpm --dir src run check-types pnpm knip pnpm knip:productionThe SDD models cover credential access, report integrity, baseline promotion, bot handoff, and publication independence.
All base configurations passed. Guard-removal variants failed as expected. Code tests detected the corresponding removed guards.
Reporting and promotion use separate models. They check 1,364 states combined, compared with 6,400 before separation. The release model checks 10 states.
The models check their stated abstractions. They do not prove the implementation or hosted settings correct.
Pre-Submission Checklist
Provider listing, recorded streams, and visual snapshots do not apply.
Documentation Updates
Updated the evaluation README, release command, kickoff instructions, and baseline promotion command.
The README documents tag rules, environment approvals, webhook setup, and model checks. Keep Actions PR creation disabled.
Additional Notes
Repository settings remain unchanged. Maintainers must configure the protected tag and environment rules before live use.
No live provider evaluation or Discord notification ran during this work. The first live evaluation and Zoomote PR handoff remain unverified.
Cost estimates stay unavailable until maintainers configure real rates.
AI assistance was used for implementation, models, tests, and PR preparation.